package com.smart.config.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * .............................................
 * When I wrote this, only God and I understood what I was doing
 * Now, God only knows
 * .............................................
 *
 * @ProjectName: spring-boot-example
 * @Package: com.smart.config.configuration
 * @ClassName: Druid
 * @Description: 描述
 * @Author: zhangwei
 * @CreateDate: 2021/12/6 16:33
 * @UpdateUser: 更新者
 * @UpdateDate: 2021/12/6 16:33
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Configuration
public class DruidConfiguration {
    @Resource
    private UserProperties properties;
    @Value("${user.username}")
    private String username;
    @Value("${user.password}")
    private String password;

    @Bean
    public User user() {
        User user = new User();
        user.setUsername(username);
        user.setPassword(password);
        return user;
    }
}
